#include <syscall.h>
#include <mmu.h>

#include "ulayout.h"
		
		.text
		.code32

		.globl _start

_start:
		movl 	$0, %ebp
		movl	$init_stack, %esp
		call	user_entry

		.globl spin
spin:
		jmp		spin

		.data

		.globl rkv_data
rkv_data:
#include "../target/rkv_data.S"

#define	SRL(val, shamt)	(((val) >> (shamt)) & ~(-1 << (32 - (shamt))))
#include <layout.h>

		.globl vpt
		.globl vpd
		.globl procs
		.globl lapic
		.globl sysconf
		
		.set	vpt, UVPT
		.set	vpd, (UVPT + SRL(UVPT, 10))
		.set	procs, UPROCS
		.set	lapic, ULAPIC
		.set	sysconf, USYSCONF

		.globl  va_items
		.globl  va_ctrl
		
		.set	va_items, UHHEAD
		.set	va_ctrl, UHHEAD

		.globl lna
		.globl ips_nodes

		.set    lna, ULNA
		.set    ips_nodes, ULNA

		
		.align PAGE_SIZE
		.globl init_stack

		.space PAGE_SIZE * 4
init_stack:
